package com.forezp.service;

import com.forezp.dao.DataSourceDao;
import com.forezp.entity.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * springboot-jdbc-DataSourceService
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/3/16 14:16
 */
@Service
public class DataSourceService {

    @Autowired
    private DataSourceDao dataSourceDao;


    public List<DataSource> getAll() {
        return dataSourceDao.findAll();
    }

    public DataSource findById(Integer dataSourceId) {
        return dataSourceDao.findOne(dataSourceId);
    }

    public void save(DataSource dataSource) {
        dataSourceDao.save(dataSource);
    }
}
